<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<title>个人中心</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="css/mui.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="css/common.css"/>
		<link rel="stylesheet" type="text/css" href="css/index.css"/>
	</head>
	<body >
		<header class="mui-bar mui-bar-nav">
		    <h1 class="mui-title">个人中心</h1>
		</header>
		<nav class="mui-bar mui-bar-tab">
	    <a class="mui-tab-item1 " href="index.html">
	        <span class="mui-icon "><img src="images/tab_index01.png"/></span>
	        <span class="mui-tab-label">拍拍拍</span>
	    </a>
	    <a class="mui-tab-item1" href="indexRelease.html">
	        <span class="mui-icon "><img src="images/tab_index02.png"/></span>
	        <span class="mui-tab-label">发布</span>
	    </a>
	    <a class="mui-tab-item1" href="msg.html">
	        <span class="mui-icon "><img src="images/tab_index03.png"/></span>
	        <span class="mui-tab-label">消息</span>
	    </a>
	    <a class="mui-tab-item1 mui-active" href="my.html">
	        <span class="mui-icon"><img src="images/tab_index04.png"/></span>
	        <span class="mui-tab-label">我的</span>
	    </a>
	</nav>
		<div class="mui-content" id="app">
			<div class="padding_b30 bg_ff">
		    <div class="my_top bg_ff">
		    	<dl class="clearfix width80">
		    		<dt class="left relative mg_r10">
		    			<img class="head" src="images/head.png"/>
		    			<a href="mydata.html">
		    				<img class="icon_editer" src="images/icon_editor.png"/>
		    			</a>
		    		</dt>
		    		<dd class="left">
		    			<h5 class=" mg_top10">
		    				<span class="my_name"></span>  
		    				<img width="25" class="vip_icon" src="images/vip.png"/></h5>
		    			<p class="mg_top10 labels mui-ellipsis"></p>
		    		</dd>
		    	</dl>
		    	
		    </div>
		    <ul class=" myzan bg_ff">
		    	<li>
		    		<p class="color_00 praiseNum"></p>
		    		<p class="color_6">获赞</p>
		    	</li>
		    	<li>
		    		<a href="userNickname.html">
			    		<p class="color_00 fansNum"></p>
			    		<p class="color_6 ">粉丝</p>
		    		</a>
		    	</li>
		    	<li>
		    		<a href="userNickname.html">
			    		<p class="color_00 focusNum"></p>
			    		<p class="color_6">关注</p>
		    		</a>
		    	</li>
		    </ul>
		      <ul class=" myzan bg_ff other mg_top10">
			    	<li>
			    		<a href="javascript:void(0);" class="money" onclick="getbag()">
			    			<img src="images/my_bag.png"/>
			    			钱包
			    		</a>
			    		
			    	</li>
			    	<li>
			    		<a href="friends.html" class="inviteCode" >
			    			<img src="images/my_yq.png"/>
			    			邀请
			    		</a>
			    	</li>
			    	<li>
			    		<a href="mySet.html">
				    		<img src="images/my_set.png"/>
				    		设置
			    		</a>
			    	</li>
			    </ul>
		    </div>
		    <div class="my_list bg_ff">
		    	<h5 class="color_00 mg_lr10">作品(<span class="num"></span>)</h5>
		    	
			   <div class="my_listitem">
		    		<!--<dl class="list_item">
		    			<a href="detial.html" class="width100">
			    			<dt class="relative">
			    				<img src="images/bg1.png"/>
			    				<p class="absolute list_text mui-ellipsis">文字内容文字内容文字...</p>
			    			</dt>
			    			<dd class="mg_tb10">
			    				<img src="images/headimg.png"/>
			    				昵称1
			    			</dd>
		    			</a>
		    		</dl>-->
		    		
		    	</div>
		    </div>
		    
		    

		</div>
		
		
		<script src="js/mui.js"></script>
		<script src="js/jquery-1.7.1.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/index.js" type="text/javascript" charset="utf-8"></script>
		<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
		<script type="text/javascript">
			mui.init()
			$(".more_icon").click(function(){
				$('.mytop_more').fadeIn(200)
			})
			$('.mytop_more a').click(function(){
				$('.mytop_more').fadeOut(200)
			})
			var inviteCode='',integral=''
//			
			
			
			//获取我的信息
			function getUserInfoById(){
				$('.gif').show()
				$.ajax({
					type:"post",
					url:urlcom + "user/getUserInfoById",
					async:true,
					dataType:'json',
					data:{
						userId:localStorage.getItem('userId')
					},
					success:function(res){
						$('.gif').hide()
						if(res.code==0){
							$('.my_name').html(res.data.name)//用户名
							$('.head').attr('src',res.data.headImg)//头像
							$('.praiseNum').html(res.data.praiseNum)//点赞
							$('.fansNum').html(res.data.fansNum)//粉丝
							$('.focusNum').html(res.data.focusNum)//关注
							$('.labels').html(res.data.labels)//自我签名
							$('.inviteCode').attr('code',res.data.inviteCode)//邀请码
							$('.money').attr('integral',res.data.integral)//积分
							console.log(res.data.isVip)
							
							//判断是否是vip
							if(res.data.isVip == 1){
								$('.vip_icon').show()
							}else{
								$('.vip_icon').hide()
							}
						}else{
							msg(res.msg)
						}
		 			}
			     })
			}
			getUserInfoById()
			
			//获取作品列表
			function getWorkByUserId(current){
				$.ajax({
					type:"post",
					url:urlcom + "userCenter/getWorkByUserId",
					async:true,
					dataType:'json',
					data:{
						userId:localStorage.getItem('userId'),
						current:current,
						size:10
					},
					success:function(res){
						if(res.code==0){
							if(res.data.length){
								
								$('.num').html(res.data.length)
								var html='';
								$.each(res.data, function(k,v) {
									html+='<dl class="list_item">'+
						    			'<a href="detial.html?id='+v.workId+'" class="width100">'+
							    			'<dt class="relative">'+
							    				'<img src="'+v.coverImg+'"/>'+
							    				'<p class="absolute list_text mui-ellipsis">'+v.content+'</p>'+
							    			'</dt>'+
							    			'<dd class="mg_tb10"><img src="'+v.userHeadImg+'"/>'+v.praiseNum+'</dd>'+
						    			'</a>'+
						    		'</dl>'
								});
								$('.my_listitem').html(html)
							}else{
								$('.num').html('0')
							}
							
							
							
						}else{
							msg(res.msg)
						}
		 			}
			     })
			}getWorkByUserId(1)
			
			function getbag(){
				var integral = $('.money').attr('integral')
				window.location.href = 'myBag.html?integral='+integral
			}
			
		</script>
		
	</body>

</html>
